package com.cvut.fit.bluetoothcarhandheld;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class BluetoothCarHandheldActivity extends Activity {
	
	
	int counter = 0;
	Button add,sub;
	TextView text;
	
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        
      
        add = (Button)findViewById(R.id.bAdd);
        sub = (Button)findViewById(R.id.bSub);
        text = (TextView)findViewById(R.id.tvView);
        
        add.setOnClickListener(new View.OnClickListener() {
			
			public void onClick(View v) {
				// TODO Auto-generated method stub
				counter++;
				text.setText("Your total is " + counter);
			}
		});
        
        sub.setOnClickListener(new View.OnClickListener() {
			
			public void onClick(View v) {
				// TODO Auto-generated method stub
				counter--;
				text.setText("Your total is " + counter);
			}
		});
         
       
    }
}